simplify document handler programs with the sax parser 使用sax解析器简化文档处理程序的编写
the first step in the design strategy is to write a generalized document handler 设计策略的第一步是编写一个通用的文档处理程序。
the sax parser, the document handler, and the external classes for the other elements do not need any changes sax解析器、文档处理程序以及用于其他元素的外部类都不需要作任何修改。
you can now change the behavior for one of the elements without changing either the document handler code or the code for the other elements 现在可以改变一个元素的行为,而不必修改文档处理程序代码或者其他元素的代码。
the document handler class is generalized through the use of the java reflection mechanism, while an abstract class is used to implement the element classes 通过使用java反射机制来泛化文档处理程序类,并使用一个抽象类来实现元素类。